<?
//status: regmail:0 ; off: 1; onchat:2; oncpanel: 3 ; lock:4

$username= isset($_POST['username']) ? $_POST['username'] : "";
$password= isset($_POST['password']) ? $_POST['password'] : "";

if(!empty($username) || !empty($password))
{
	$password=md5($password);
	$rs=$dbsql->query("select * from ".$GLOBALS['first_table']."tbluser where cUserName='$username' and cPassword='$password' and iStatus!=0 and iStatus!=4 and iParentId=0");
	if($rq=$dbsql->fetch_array($rs))
	{
		$_SESSION['userIdCP']=$rq['iUserId'];
		header("location: index.php");
		exit;
	}
}

?>